package com.nuist.springmvcdemo.service;

import com.nuist.springmvcdemo.mapper.MessageInfoMapper;
import com.nuist.springmvcdemo.model.messageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageService {
    @Autowired
    private MessageInfoMapper messageInfoMapper;

    public Integer publishMessage(messageInfo messageInfo) {
        return messageInfoMapper.insertMessageInfo(messageInfo);
    }

    public List<messageInfo> getMessageList() {
        return messageInfoMapper.selectAlllist();
    }
}
